package com.example.wanglong.myoneapplication.activity;

import android.os.Bundle;
import android.widget.ListView;

import com.example.wanglong.myoneapplication.adapter.VisaDetailAdapter;
import com.example.wanglong.myoneapplication.adapter.VisaOrderAdapter;
import com.example.wanglong.myoneapplication.common.BaseActivity;
import com.example.wanglong.myoneapplication.R;
import com.example.wanglong.myoneapplication.entity.VisaDetailEntity;
import com.example.wanglong.myoneapplication.entity.VisaOrderEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wang.long on 2016/4/20.
 */
public class VisaOrderListActivity extends BaseActivity {

    private List<VisaOrderEntity> orderList=new ArrayList<VisaOrderEntity>();
    private int pagesum=0;
    private ListView orderlistView;
    private VisaOrderAdapter adapter;

    @Override
    protected void onCreate(Bundle saveInstanceState){
        super.onCreate(saveInstanceState);

        super.setContentView(R.layout.visaorderlist);

        //init
        initData();
    }

    public void initData(){

        orderlistView=(ListView) findViewById(R.id.listorder);


        for(int i=0;i<20;i++){
            String title="徽州王大锤"+String.valueOf(i)+"个人旅游签证";
            String time="09-"+String.valueOf(i)+"出发";
            String price=String.valueOf(i*200);
            String orderpricetype=(i%2==0)?"已付款":"确认中";
            String ordertype=(i%2==0)?"修改订单":"取消";
            VisaOrderEntity visa=new VisaOrderEntity(i,title,time,price,ordertype,orderpricetype);
            orderList.add(visa);
        }

        adapter=new VisaOrderAdapter(VisaOrderListActivity.this,R.layout.visaorderlist_item,orderList);

        orderlistView.setAdapter(adapter);

    }
}
